import store from "../vuex";
const dataList=[]
const init = function init(){
  let ws = new WebSocket('ws://192.168.3.236:8889');
  ws.onopen = function () {
      console.log('客户端连接成功');
      ws.send('hello');
  }
  ws.onmessage = function (event) {
      console.log('收到服务器的响应 ' + event.data);
      dataList.push(event.data)
      store.commit('changeDom',dataList)
  }
}

export {
  dataList,
  init
}